<?php //variation
    //$link = mysql_connect('localhost', 'ocmanozc_user1', '+0Fg8.8S-?pc');
    $link = mysql_connect('localhost', 'root', '');
    if (!$link) {
        die('Could not connect: ' . mysql_error());
    }
    $query = "select * from projects order by id asc";
    
    mysql_select_db("ocmanozc_manager");
    $result = mysql_query($query);
    
    
    //mysql_close($link);
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title>
			Contract Variations
		</title>

		<link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" />
		<link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.min.css" />
		<link rel="stylesheet" href="variation.css" />
		<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
		<script type="text/javascript" src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js">	</script>
		<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.core.min.js"></script>
		<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.calbox.min.js"></script>
		<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/i18n/jquery.mobile.datebox.i18n.en_US.utf8.js"></script>
		<script type="text/javascript" src="items.js"></script>
	</head>
    

	<body>
		<!-- Home -->
		<form id="variation" action="index.php" method="post">
			<div data-role="page" id="page1" style="position: relative;">
				<div data-role="content" id="logo">
					<img src="ozcretelogo.png" />
					
					<div id="addr">
						<strong>
							Ozcrete Pools Pty Ltd
						</strong>
						<br />
						ABN: 74984824030
						<br />
						BSA: 1100119
						<br />
						Ph: 07 55466443
						<br />
						Mob: 0418756170
						<br />
						Email: info@ozcrete.com.au
						<br />
						48 Conebush Circuit
						<br />
						Ormeu QLD 4820
					</div>
				</div>
				<!-- logo end -->
				<div data-role="content" style="padding: 15px">
					<h2>
						Contract Variation
					</h2>
					<div data-role="collapsible-set" data-theme="" data-content-theme="">
						<div data-role="collapsible" data-collapsed="true">
							<h3>
								Date Of
							</h3>
							<div data-role="fieldcontain" class="ui-field-contain ui-body ui-br">
								<label for="mydate" class="ui-hidden-accessible">
									Date
								</label>
								<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "calbox"}' value="<?php echo date('m/d/Y');?>" />
							</div>
						</div>
						<div data-role="collapsible" data-collapsed="true">
							<h3>
								Project
							</h3>
							<div data-role="fieldcontain" class="ui-hide-label">
								<label for="selectmenu1">
								</label>
								<select name="selectmenu1" id="selectmenu1">
									<?php
                                    while ($row = mysql_fetch_assoc($result)) {
                                        echo "<option value='" . $row['projectname']. "'>" . $row['projectname']."</option>";
                                    } 
                                    															
                                    
                                    ?>
                                    
								</select>
							</div>
						</div>
						<div data-role="collapsible" data-collapsed="true">
							<h3>
								Site
							</h3>
							<div data-role="fieldcontain" class="ui-hide-label">
								<label for="selectmenu2">
								</label>
								<select name="selectmenu2" id="selectmenu2">
									<option value="site1">
										Site 1
									</option>
								</select>
							</div>
						</div>
						<div data-role="collapsible" data-collapsed="true">
							<h3>
								Description Of
							</h3>
							<div data-role="fieldcontain" class="ui-hide-label">
								<label for="textarea1">
								</label>
								<textarea id="textarea1" placeholder="">
									&nbsp;
								</textarea>
							</div>
						</div>
						<div>
							<h3>
								Items
							</h3>
							<div id="testout">
							</div>
							<table id="items" style="width: 99%;" border="0" cellspacing="0" cellpadding="2">
								<colgroup>
									<col width="8%" />
									<col width="60%" />
									<col width="12%" />
									<col width="20%" />
								</colgroup>
								<thead>
									<tr>
										<th>QTY</th>
										<th>Item Description</th>
										<th>Unit Price</th>
										<th>Total</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" id="qty1" class="qty"  size="4" value="0" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea data-enhance="false" type="textarea" name="desc[]" cols="20"  style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input data-enhance="false" type="number" size="7" name="uprice[]" class="uprice" value="0" />
											</div>
										</td>
										<td id="result1">
											<input type="text"  class="item_total" align="center" value=""   />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input data-enhance="false" type="number" name="qty[]" class="qty" size="4" value="0" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]" id="desc2" cols="20" style="width: 95%" ></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" class="uprice" value="0"  value="0" />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center" value=""   />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" id="qty3" class="qty"  size="4" value="0" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]" id="desc3" cols="20" style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" value="0" class="uprice"   />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"   />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" value="0" class="qty" size="4" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]" cols="20" style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" value="0" class="uprice"  />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"   />
										</td>   
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" value="0" class="qty"  size="4" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]" cols="20" style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" value="0" class="uprice"    />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"   />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" value="0" class="qty"    size="4" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]"  cols="20" style="width: 95%"></textarea>
											</div>
							   			</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" value="0" class="uprice"  />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"   />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" value="0" class="qty" size="4" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]"  cols="20" style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" value="0" class="uprice"  />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"   />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" value="0" class="qty"  size="4" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]"  cols="20" style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" value="0" class="uprice"  />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"   />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" name="qty[]" value="0" class="qty"  />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]" cols="20" style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" class="uprice" value="0"  />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"  />
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
												<input type="number" class="qty" name="qty[]" value="0" class="qty"  size="4" />
											</div>
										</td>
										<td>
											<div align="center">
												<textarea type="textarea" name="desc[]"  cols="20" style="width: 95%"></textarea>
											</div>
										</td>
										<td>
											<div align="center">
												<input type="number" size="7" name="uprice[]" class="uprice" value="0" />
											</div>
										</td>
										<td>
											<input type="text"  class="item_total" align="center"  />
										</td>
									</tr>
								</tbody>
								<tfoot>
									<tr>
										<td>
											<div align="center">
											</div>
										</td>
										<td>
											<div align="center">
											</div>
										</td>
										<td>
											<div align="center">
											</div>
										</td>
										<td>
											<div align="center">
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div align="center">
											</div>
										</td>
										<td>
											<div align="center">
											</div>
										</td>
										<td>
											<div align="center">
											</div>
										</td>
										<td>
											<div align="center">
											</div>
										</td>
									</tr>
									<tr>
										<td>
											&nbsp;
										</td>
                                        <td>
											&nbsp;
										</td>
										<td>
											<div align="right">
												Total Of:
											</div>
										</td>

										<td>
											<div id="total">
												0.00
											</div>
										</td>
									</tr>
									<tr>
										<td>
											&nbsp;
										</td>
                                        <td>
											&nbsp;
										</td>
										<td>
											<div align="right">
												10% GST:
											</div>
										</td>
										
										<td>
											<div id="gst">
												0.00
											</div>
										</td>
									</tr>
									<tr>
										<td>
											&nbsp;
										</td>
                                        <td>
											&nbsp;
										</td>
										<td>
											<div align="right">
												Total + GST:
											</div>
										</td>
										
										<td>
											<div id="total-gst">
												0.00
											</div>
										</td>
									</tr>
									<tr>
										
                                        <td>
											&nbsp;
										</td>
                                        <td>
											&nbsp;
										</td>
                                        <td>
											<input type="button" value="submit" class="ui-bar ui-block-b" data-role="button" />
										</td>
									</tr>
								</tfoot>
							</table>
						</div>
						<!-- items capsule-->
					</div>
				</div>
			</div>
		</form>
	</body>

</html>